package com.zhudi.commen;

import java.security.SecureRandom;

/**
 * 这个类用来生成一些固定的错误
 */
public class ResultUtils {

    public static <T> BaseResponse<T> Error(ErrorCode errorCode,String description){
        return new BaseResponse<T>(errorCode.getCode(), null, errorCode.getMessage(),description);
    }
    public static BaseResponse<?> Error(int code, String message, String description) {
        return new BaseResponse<>(code, null,message,description);
    }
    public static <T> BaseResponse<T> success(T data, String description){
        return new BaseResponse<T>(ErrorCode.SUCCESS.getCode(),data,ErrorCode.SUCCESS.getMessage(),description);
    }

}
